package com.ziytek.web.citizen.model.rsp;

import com.ziytek.web.citizen.constant.ServerConstant;
import com.ziytek.web.citizen.model.bean.BrattyRealData;
import lombok.Data;

import java.util.List;

/**
 * 电池实时数据查询接口响应
 * @author fenghx
 * @version v1.0
 * @className QueryRealVoltageResponse
 * @description 功能描述
 * @date 2023/6/28 16:44
 **/
@Data
public class RealtimeDataRsp {
    /**
     * 返回编码
     */
    private String retCode;

    /**
     * 编码描述
     */
    private String retMsg;

    /**
     * 电池实时数据详情
     */
    private List<BrattyRealData> data;

    public void error() {
        this.retCode = ServerConstant.ERROR;
        this.retMsg = ServerConstant.ERROR_MSG;
    }

    public void error(String msg) {
        this.retCode = ServerConstant.ERROR;
        this.retMsg = msg;
    }

    public void success() {
        this.retCode = ServerConstant.SUCCESS;
        this.retMsg = ServerConstant.SUCCESS_MSG;
    }
}